\documentclass{ctexart}
\usepackage{amsmath}
\usepackage{amssymb}
\title{第二次课堂作业}
\author{邵柯欣 \\ 3200103310}
\begin{document}
\maketitle
\section{1.9}
解：\\
$Pr(M_1)=0.25$ and $Pr(M_2)=0.75$,$Pr(D|M_1)=0.5$ and $Pr(D|M_2)=0.01$\\
由贝叶斯公式，得\\
$P(M_1|D)=\frac{P(M_1)P(D|M_1)}{P(M_1)P(D|M_1)+P(M_2)P(D|M_2)}=0.625$\\
$P(M_2|D)=\frac{P(M_2)P(D|M_2)}{P(M_1)P(D|M_1)+P(M_2)P(D|M_2)}=0.375$

\section{1.10}
解：\\
因为$x_1,x_2,x_3$是相互独立的，\\
$P(x_1,x_2,x_3|M)=P(x_1|M)*P(x_2|M)*P(x_3|M)=0.01$

\section{1.11}
解：\\
已知$f(x)=\frac{1}{4}e^{-\frac{|M-x|}{2}},P(M=0)=0.25,P(M=2)=0.35,P(M=4)=0.4$\\
$P(M|D)=\frac{P(D|M)P(M)}{P(D)}$\\
$Pr(D|M)=\prod\limits_{x \in D}f(x)$\\
$ln(Pr(D|M))=\sum\limits_{x \in D}(-|M-x|) + |D|ln(1/4)$\\
$ln(Pr(D|M=0))=-\frac{1+6+0+2+1+7+7+8+4+2}{2}+10*ln(\frac{1}{4})=10*ln{\frac{1}{4}}-19$\\
$ln(Pr(D|M=2))=-\frac{3+4+2+0+3+5+5+6+2+4}{2}+10*ln(\frac{1}{4})=10*ln{\frac{1}{4}}-17$\\
$ln(Pr(D|M=4))=-\frac{5+2+4+2+5+3+3+4+0+6}{2}+10*ln(\frac{1}{4})=10*ln{\frac{1}{4}}-17$\\
所以M=4的概率最大。

\section{1.13}
解：\\
当v=1.7L，\\
$Pr(M=1.7)=\frac{1}{\sqrt{2*\pi}*0.2}*e^{-\frac{0.3^2}{2*0.2^2}}$\\
$Pr(D|M=1.7)=\prod\limits_{x \in D}fv(x)=C^{10}*e^{-\frac{1}{2*0.1^2}*(0.12^2+0.01^2+0.64^2+0.51^2+0.31^2+0.25^2+0.06^2+0.24^2+0.32^2+0.19^2)}$\\
$Pr(M=1.7|D)=\frac{1}{\sqrt{2*\pi}*0.2}*C^{10}*e^{-53.25}*Pr(D)$\\
当v=1.8L，\\
$Pr(M=1.8)=\frac{1}{\sqrt{2*\pi}*0.2}*e^{-\frac{0.2^2}{2*0.2^2}}$\\
$Pr(D|M=1.8)=\prod\limits_{x \in D}fv(x)=C^{10}*e^{-\frac{1}{2*0.1^2}*(0.02^2+0.09^2+0.54^2+0.41^2+0.21^2+0.15^2+0.04^2+0.14^2+0.22^2+0.09^2)}$\\
$Pr(M=1.8|D)=\frac{1}{\sqrt{2*\pi}*0.2}*C^{10}*e^{-31.125}*Pr(D)$\\
当v=1.9L，\\
$Pr(M=1.9)=\frac{1}{\sqrt{2*\pi}*0.2}*e^{-\frac{0.1^2}{2*0.2^2}}$\\
$Pr(D|M=1.9)=\prod\limits_{x \in D}fv(x)=C^{10}*e^{-\frac{1}{2*0.1^2}*(0.08^2+0.19^2+0.44^2+0.31^2+0.11^2+0.05^2+0.14^2+0.04^2+0.12^2+0.01^2)}$\\
$Pr(M=1.9|D)=\frac{1}{\sqrt{2*\pi}*0.2}*C^{10}*e^{-19.25}*Pr(D)$\\
当v=2.0L，\\
$Pr(M=2.0)=\frac{1}{\sqrt{2*\pi}*0.2}*e^{-\frac{0.0^2}{2*0.2^2}}$\\
$Pr(D|M=2.0)=\prod\limits_{x \in D}fv(x)=C^{10}*e^{-\frac{1}{2*0.1^2}*(0.18^2+0.29^2+0.34^2+0.21^2+0.01^2+0.05^2+0.24^2+0.06^2+0.02^2+0.11^2)}$\\
$Pr(M=2.0|D)=\frac{1}{\sqrt{2*\pi}*0.2}*C^{10}*e^{-17.625}*Pr(D)$\\
当v=2.1L，\\
$Pr(M=2.1)=\frac{1}{\sqrt{2*\pi}*0.2}*e^{-\frac{0.1^2}{2*0.2^2}}$\\
$Pr(D|M=2.1)=\prod\limits_{x \in D}fv(x)=C^{10}*e^{-\frac{1}{2*0.1^2}*(0.28^2+0.39^2+0.24^2+0.11^2+0.09^2+0.15^2+0.34^2+0.16^2+0.08^2+0.21^2)}$\\
$Pr(M=2.1|D)=\frac{1}{\sqrt{2*\pi}*0.2}*C^{10}*e^{-26.25}*Pr(D)$\\
当v=2.2L，\\
$Pr(M=2.2)=\frac{1}{\sqrt{2*\pi}*0.2}*e^{-\frac{0.2^2}{2*0.2^2}}$\\
$Pr(D|M=2.2)=\prod\limits_{x \in D}fv(x)=C^{10}*e^{-\frac{1}{2*0.1^2}*(0.38^2+0.49^2+0.14^2+0.01^2+0.19^2+0.25^2+0.44^2+0.26^2+0.18^2+0.31^2)}$\\
$Pr(M=2.2|D)=\frac{1}{\sqrt{2*\pi}*0.2}*C^{10}*e^{-42.335}*Pr(D)$\\
当v=2.3L，\\
$Pr(M=2.3)=\frac{1}{\sqrt{2*\pi}*0.2}*e^{-\frac{0.3^2}{2*0.2^2}}$\\
$Pr(D|M=2.3)=\prod\limits_{x \in D}fv(x)=C^{10}*e^{-\frac{1}{2*0.1^2}*(0.48^2+0.59^2+0.04^2+0.09^2+0.29^2+0.35^2+0.54^2+0.36^2+0.28^2+0.41^2)}$\\
$Pr(M=2.3|D)=\frac{1}{\sqrt{2*\pi}*0.2}*C^{10}*e^{-74.25}*Pr(D)$\\
综上所述，$v=2.0$概率最大。

\end{document}
